@extends('admin.app')

@section('content')
  <div class="panel panel-default">
    <div class="panel-heading font-bold">
      分润详情
    </div>
    <div class="panel-body">
      <form action="{{ admin_action('Business\DemandController@profit',[$project]) }}"  class="form-horizontal">
        <div class="form-group">
          <div class="col-sm-1 control-label">参与方姓名</div>
          <div class="col-sm-2">
            <input type="text" class="form-control" name="user_name" value="{{ $query['user_name'] ?? '' }}" placeholder="请输入姓名">
          </div>
          <div class="pull-right m-r">
            <button class="btn btn-primary" type="submit">查询</button>
          </div>
        </div>
      </form>
      <div class="table-responsive">
        <table class="table table-striped b-t b-light">
          <thead>
            <tr>
              <th>类型</th>
              <th>交易流水号</th>
              <th>应还款时间</th>
              <th>实际还款时间</th>
              <th>参与角色</th>
              <th>参与方姓名</th>
              <th>分润金额(元)</th>
              <th>利息(元)</th>
              <th>融资方姓名</th>
              <th>交易状态</th>
            </tr>
          </thead>
          <tbody>
          @forelse ($list as $row)
            <tr>
              <td>{{$row->type==1?'还款':'分润'}}</td>
              <td>{{$row->sn}}</td>
              <td>{{$row->input_time}}</td>
              <td>{{$row->pay_time}}</td>
              <td>{{$row->role_slug}}</td>
              <td>{{$row->user_name}}</td>
              <td>{{$row->money}}</td>
              <td>{{$row->profit}}</td>
              <td>{{$project->financier_name}}</td>
              <td>{{$row->status?'已支付':'未支付'}}</td>
            </tr>
            @empty
            <tr>
              <td colspan="7" class="text-center">没有找到记录</td>
            </tr>
            @endforelse
          </tbody>
        </table>
      </div>
    </div>
    <div class="panel-footer">
      <div class="row">
        <div class="col-sm-12 text-right text-center-xs">                
          {{ $links }}
        </div>
      </div>
    </div>
  </div>
@endsection